<?php

namespace App\Models\User\Traits\Relationship;

use App\Models\User\SocialLogin;

/**
 * Class UserRelationship
 * @package App\Models\User\Traits\Relationship
 */
trait UserRelationship
{


    /**
     * one-to-one relations with user_relate.
     *
     * @return \Illuminate\Database\Eloquent\Relations\hasOne
     */
    public function relation()
    {
        return $this->belongsToMany('App\Models\User\User','user_relate','internal_uid','external_uid');
    }
    /**
     * one-to-many relations with orders.
     *
     * @return \Illuminate\Database\Eloquent\Relations\hasMany
     */
    public function orders()
    {
        return $this->belongsToMany('App\Models\Orders\Order');
    }
    /**
     * one-to-one relations with .
     *
     * @return \Illuminate\Database\Eloquent\Relations\hasOne
     */
    public function ext()
    {
        return $this->hasOne('App\Models\User\UserExt','user_id','id');
    }

}